package com.ruoyi.back.controller

import com.ruoyi.app.common.Data
import com.ruoyi.back.domain.SpreadCenterSetting
import com.ruoyi.back.service.SpreadCenterSettingService
import io.swagger.annotations.Api
import io.swagger.annotations.ApiOperation
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.web.bind.annotation.*

@RestController
@RequestMapping("system/spreadCenterSetting")
@Api(tags = ["个人中心-推广中心-设置"])
class SpreadCenterSettingController {

    @Autowired
    private lateinit var spreadCenterSettingService: SpreadCenterSettingService

    @ApiOperation("获取推广中心设置")
    @GetMapping("get")
    fun getSpreadCenterSetting(): Data<SpreadCenterSetting> = spreadCenterSettingService.getSpreadCenterSetting()

    @ApiOperation("设置推广中心")
    @PostMapping("save")
    fun saveSpreadCenterSetting(@RequestBody spreadCenterSetting: SpreadCenterSetting): Data<Boolean> = spreadCenterSettingService.saveSpreadCenterSetting(spreadCenterSetting)
}